// 引入封装好的基础地址
import baseUrl from './barUrl'

let http =(obj)=>{
	 return new Promise((resolve,reject)=>{
		 uni.request({
		 	url:baseUrl +'/api'+obj.url,
			method:obj.method || 'get',
			data:obj.data || {},
			header:obj.header || {
				"content-type":"application/json"
			},
			success(res){
				// console.log(res,"222");
				resolve(res)
			},
			fail(err){
				reject(err)
			}
		 })
	 })
}

export default http